package com.note.controller;

import com.alibaba.fastjson.JSONObject;
import com.config.SpringContextUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/6/25 14:12
 * @since JDK 1.8
 */
@RestController
@RequestMapping("test")
public class TestController {

    @GetMapping("test")
    public JSONObject test22Controller(){
      Map<String, String> stringMap=SpringContextUtils.getBeanObj("dbmap");
      JSONObject jsonObject=new JSONObject();
      stringMap.forEach((k,v)->{
          jsonObject.put(k,v);
      });
      return jsonObject;
    }
}
